﻿namespace CSharpPro.Properties._1021;

public class Student
{
    private int id;
    private string name;
    private string userEmail;

    public string UserEmail
    {
        get => userEmail;
        set => userEmail = value ?? throw new ArgumentNullException(nameof(value));
    }

    public string Name
    {
        get => name;
        set => name = value ?? throw new ArgumentNullException(nameof(value));
    }

    public int Id
    {
        get
        {
            return id;
        }
        set
        {
            if (value <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(value));
            }
        }
    }

  

    

    public Student(int id, string name)
    {
        this.id = id;
        this.name = name;
    }


    public Student()
    {
    }

    public override string ToString()
    {
        return $"id = {id}, name = {name}";
    }
}